package org.zht.dormpro.dorm.mapper;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.zht.dormpro.auth.bean.PageBean;
import org.zht.dormpro.dorm.bean.StudentDTO;
import org.zht.dormpro.dorm.model.TbStudent;

import java.util.List;
import java.util.Map;

public interface TbStudentMapper {
    @Delete({
        "delete from tb_student",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer id);


    int insertSelective(TbStudent record);

    @Select({
        "select",
        "id, stu_id, stu_name, stu_age, stu_image, stu_sex, in_date, cla_id, floor_id, ",
        "dorm_id, bed_id, stu_email, stu_phone, stu_append, stu_status",
        "from tb_student",
        "where id = #{id,jdbcType=INTEGER}"
    })
    @ResultMap("org.zht.dormpro.dorm.mapper.TbStudentMapper.BaseResultMap")
    TbStudent selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(TbStudent record);

    List<TbStudent> getStudentListByCondition(PageBean pageBean);
}